package game.adm.controller;
import game.adm.dao.dto.PayDTO;
import game.adm.entity.PayEntityManager;
import game.adm.struts.form.PayForm;
import game.web.base.Constants;
import projectx.core.base.ProjectXSystemException;
import projectx.core.base.ProjectXUserException;
import projectx.transaction.TransactionHandler;
import projectx.web.base.ProjectXDbTrxController;
import projectx.web.base.ProjectXForm;
import projectx.web.base.UserContext;

public class PayInitController extends ProjectXDbTrxController {

	protected PayInitController(UserContext uc, ProjectXForm form) {
		super(uc, form);
	}

	@Override
	public Object execute() throws ProjectXUserException,
			ProjectXSystemException {
		debugBegin();
		UserContext uc = getUc();
		PayForm form = (PayForm)getForm();
		PayDTO dto= PayEntityManager.getPay();
		uc.put(Constants.ADM_PAY_RECORD, dto);
		debugEnd();
		return null;
	}

	public static Object execute(UserContext uc, ProjectXForm form)
			throws ProjectXUserException, ProjectXSystemException {
		return TransactionHandler.call(new PayInitController(uc, form));
	}
}
